package collector.app.nexd.com.singlecollection.application;

import android.app.Application;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;

import collector.app.nexd.com.singlecollection.presenter.db.NexdSqlOpenHelper;

/**
 * Created by xun on 2016/8/4.
 */
public class NexdApplication extends Application {
    private static NexdApplication nexdApplication;
    private NexdSqlOpenHelper sqlHelper;
    private RequestQueue requestQueue;

    public static NexdApplication getInstance() {
        return nexdApplication;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        nexdApplication = this;
    }

    public RequestQueue getRequestQueue() {
        requestQueue=Volley.newRequestQueue(nexdApplication);
        requestQueue.start();
        return requestQueue;
    }

    public NexdSqlOpenHelper getSqlHelper() {
        if (sqlHelper == null) {
            sqlHelper = new NexdSqlOpenHelper(this);
        }
        return sqlHelper;
    }
}
